package com.lsc;

import java.util.List;

import com.lsc.clientfacade.ClientFacade;
import com.lsc.clientfacade.SessionNotLoggedInException;
import com.lsc.model.Composant;

public class EssaiFacade {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ClientFacade f=new ClientFacade();
		
		//on se loggue
		boolean res=f.login("http://10.148.8.50/testws.php", "bob", "suerte");
		if (res){
			System.out.println("login succeed");
		}else{
			System.out.println("login failed");
			System.exit(-1);
		}
		
		//on appelle getComposants
		try {
			List<Composant> lc=f.getComposants();
			//on affiche les composants 
			for (Composant c:lc){
				System.out.println(c);
			}
		} catch (SessionNotLoggedInException e) {
			e.printStackTrace();
		}
		
		
	}

}
